// src/router/index.ts

import { createRouter, createWebHistory } from 'vue-router';
import type { RouteRecordRaw } from 'vue-router';
import Home from '@/page/Home.vue';
import About from '@/page/About.vue';
import EditPage from "@/page/edit-page/index.vue";

const routes: Array<RouteRecordRaw> = [
  {
    path: '/',
    name: 'Home',
    component: Home,
  },
  {
    path: '/About',
    name: 'About',
    component: About,
  },
  {
    path: '/EditPage',
    name: 'EditPage',
    component: EditPage,
  },
];

const router = createRouter({
  history: createWebHistory(),
  routes,
});

// 在这里添加路由的导航守卫
router.beforeEach((to, from, next) => {
  console.log('Navigating to:', to.path);
  next();
});

export default router;